package com.googlecode.animator.data.materials
{
	import com.googlecode.animator.data.IValueObject;
	
	public class VideoStreamMaterialVO extends MaterialVO
	{
		public static const TYPE:String = "VideoStreamMaterial";
		
		public var filePath:String;
		
		public var width:uint = 320;
		
		public var height:uint = 240;
	
		override public function clone(src:* = null):IValueObject
		{
			var clone:IValueObject = super.clone(new VideoStreamMaterialVO());
			
			(clone as VideoStreamMaterialVO).width = this.width;
			(clone as VideoStreamMaterialVO).height = this.height;
			(clone as VideoStreamMaterialVO).filePath = this.filePath;
			
			return (clone as VideoStreamMaterialVO);
		}
		
		override public function toXML(src:XML = null):XML
		{
			var xml:XML = super.toXML(new XML(<{TYPE} face={this.face}></{TYPE}>));
			
			xml.appendChild(<width>{this.width}</width>);
			xml.appendChild(<height>{this.height}</height>);
			xml.appendChild(<filePath>{this.filePath}</filePath>);
			
			return xml;
		}
		
		override public function fromXML(src:XML):void
		{
			super.fromXML(src);
			
			this.width = src.width;
			this.height = src.height;
			this.filePath = src.filePath;
		}
	}
}